]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell/util: Remove get_content_for_window_actor()
authorRobert Mader <robert.mader@posteo.de>
Wed, 9 Jun 2021 19:18:21 +0000 (21:18 +0200)
committerRobert Mader <robert.mader@posteo.de>
Sat, 4 Sep 2021 10:10:51 +0000 (12:10 +0200)
It got replaced by `meta_window_actor_paint_to_content()`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1879>

src/shell-util.c
src/shell-util.h

index 0bc3f4d65b8dbfee5a44c8e3ad5b127b66fdd58b..bdbfe8391369345dd74010fa58a106379c000c2c 100644 (file)
@@ -354,61 +354,6 @@ shell_util_create_pixbuf_from_data (const guchar      *data,
 
 typedef const gchar *(*ShellGLGetString) (GLenum);
 
-static gboolean
-canvas_draw_cb (ClutterContent *content,
-                cairo_t        *cr,
-                gint            width,
-                gint            height,
-                gpointer        user_data)
-{
-  cairo_surface_t *surface = user_data;
-
-  cairo_set_source_surface (cr, surface, 0, 0);
-  cairo_paint (cr);
-
-  return FALSE;
-}
-
-/**
- * shell_util_get_content_for_window_actor:
- * @window_actor: a #MetaWindowActor
- * @window_rect: a #MetaRectangle
- *
- * Returns: (transfer full) (nullable): a new #ClutterContent
- */
-ClutterContent *
-shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
-                                         MetaRectangle   *window_rect)
-{
-  ClutterContent *content;
-  cairo_surface_t *surface;
-  cairo_rectangle_int_t clip;
-  gfloat actor_x, actor_y;
-
-  clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
-
-  clip.x = window_rect->x - (gint) actor_x;
-  clip.y = window_rect->y - (gint) actor_y;
-  clip.width = window_rect->width;
-  clip.height = window_rect->height;
-
-  surface = meta_window_actor_get_image (window_actor, &clip);
-
-  if (!surface)
-    return NULL;
-
-  content = clutter_canvas_new ();
-  clutter_canvas_set_size (CLUTTER_CANVAS (content),
-                           cairo_image_surface_get_width (surface),
-                           cairo_image_surface_get_height (surface));
-  g_signal_connect (content, "draw",
-                    G_CALLBACK (canvas_draw_cb), surface);
-  clutter_content_invalidate (content);
-  cairo_surface_destroy (surface);
-
-  return content;
-}
-
 cairo_surface_t *
 shell_util_composite_capture_images (ClutterCapture  *captures,
                                      int              n_captures,
index d0de033f61ea1828bad531daa7a4e2811401f0db..04485b99c1cbeef1a9484dc229366c9b16f893c3 100644 (file)
@@ -46,9 +46,6 @@ GdkPixbuf *shell_util_create_pixbuf_from_data (const guchar      *data,
                                                int                height,
                                                int                rowstride);
 
-ClutterContent * shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
-                                                          MetaRectangle   *window_rect);
-
 cairo_surface_t * shell_util_composite_capture_images (ClutterCapture  *captures,
                                                        int              n_captures,
                                                        int              x,